package com.shelpe.services.sustainer.entity.jpa;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;

import com.shelpe.services.sustainer.entity.jpa.SustainerQueue.SustainerQueuePK;

import lombok.Data;

@Entity(name = "sustainer_queue")
@IdClass(SustainerQueuePK.class)
@Data
public class SustainerQueue {
	@Id
	@Column(name="callee_id")
	private String calleeID;
	@Id
	private String calleeType;
	@Id
	private int sequence = 0;
	
	@Column(name="service_id")
	private String serviceID;
	private String path;
	private String parameter;
	@Column(name="next_jump_time")
	private Date nextJumpPoint;
	
	private Date createdTime;
	private Date modifiedTime;
	
	@Data
	public static class SustainerQueuePK implements Serializable{
		private static final long serialVersionUID = 1L;
		@Column(name="callee_id")
		private String calleeID;
		private String calleeType;
		private int sequence = 0;
		
		public SustainerQueuePK(){}
		public SustainerQueuePK(String id, String type){
			this.calleeID = id;
			this.calleeType = type;
		}
	}
}
